0 DIMK(255),P(11),D(4),A,B,C,D,E,F,G,H,I,K,L,M,Q,R,S,T,U,V,W,X,Y,Z,RD,S1,S2,LV,LI,DD,S$,I$:CLS:GOSUB500:GOTO18
1 RETURN
2 D=D(RND(4)):ONK(PEEK(P(0)+D))GOTO2:I=P(0)+D:RETURN
3 V=0:RETURN
4 V=-1:RETURN
5 V=-32:RETURN
6 V=1:RETURN
7 V=32:RETURN
8 SOUND100,1:POKEM+V,191:SOUND50,1:POKEM,U:POKEM+V,A:E=E-1:F=F-1:G=G-1:S=S+15
9 S$=STR$(S):PRINT@485,S$;:FORR=S1TOS2+LEN(S$):POKER,PEEK(R)-64:NEXT:ONFGOSUB1,60:RETURN
10 DD=I:POKEDD,H:GOSUB100:RETURN
11 POKEM,U:DD=M+V:POKEDD,A:GOSUB100:RETURN
12 SOUND100,1:POKEM,191:SOUND50,1:POKEM,A:POKEP(G-1),U:E=E-1:F=F-1:G=G-1:S=S+10:GOTO9
17 T=9:NEXT:GOTO19
18 E=8:F=9:G=7:D=-1:M=16432
19 R=16512+RND(310):FORT=0TO9:P(T)=R+T:ONK(PEEK(P(T)))GOTO17:NEXT:IFPEEK(P(0)-1)<>UTHEN19
20 FORW=1TO50:FORZ=1TOLV:POKEP(E),U:P(E)=P(G):POKEP(G),Q:ON1-(P(G)<>M)GOSUB12
26 FORT=GTO1STEP-1:P(T)=P(T-1):POKEP(T),B:NEXT:POKEM,A:I=P(0)+D:ONK(PEEK(I))GOSUB2,1,10:P(0)=I:POKEI,H
27 ONK(PEEK(K)ANDPEEK(2))GOSUB4,5,6,7:ONK(PEEK(M+V))GOSUB3,8,1,11:POKEM,U:M=M+V:POKEM,A:ONRND(2)GOTO28,29
28 ONK(PEEK(K)ANDPEEK(2))GOSUB4,5,6,7:ONK(PEEK(M+V))GOSUB3,8,1,11:POKEM,U:M=M+V:POKEM,A
29 NEXT
30 D=D(RND(4)):NEXT
40 IFW=51THENPOKEM,191:POKEM,U:L=0:S$="YOU TOOK TOO LONG. MOUSE DIED! ":GOSUB170:DD=P(0):GOSUB130:IFW<>65006THEN20
50 POKEM,U:POKEI,H:IFW=65001ANDLI>0THENGOSUB510:GOTO18
51 L=0:S$="GAME OVER!  PLAY AGAIN (Y/N)?  ":GOSUB170
52 I$=INKEY$:IFI$=""THEN52
53 IFI$="Y"THENGOSUB505:GOTO18
54 IFI$="N"THENEND
55 GOTO52
60 POKEP(1),Q:L=0:S$="THE SNAKE IS DEAD!  HIT C KEY. ":GOSUB170
70 SOUND1,4:SOUND10,15:SOUND100,15:SOUND80,8:E=8:F=9:G=7:V=0:S=S+(50-W)*5:Z=LV:W=65000
80 I$=INKEY$:IFI$<>"C"THEN80
90 RETURN
100 FORT=1TOG:POKEP(T),B:NEXT:IFD=-1ORD=-32THEN120
110 FORT=1TO10:POKEDD,124:SOUND150,1:FORC=1TO90:NEXT:POKEDD,125:SOUND100,1:FORC=1TO90:NEXT:NEXT:GOTO130
120 FORT=1TO10:POKEDD,126:SOUND150,1:FORC=1TO90:NEXT:POKEDD,125:SOUND100,1:FORC=1TO90:NEXT:NEXT
130 LI=LI-1:GOSUB160:IFLI<1THENV=0:M=16432:POKEM,U:Z=LV:W=65005:RETURN
140 V=0:M=16432:POKEM,A:POKEDD,H:SOUND10,10:W=1:RETURN
150 S$=STR$(RD):PRINT@499,S$;:FORR=MC+499TOMC+498+LEN(S$):POKER,PEEK(R)-64:NEXT:RETURN
160 S$=STR$(LI):PRINT@508,S$;:FORR=MC+508TOMC+507+LEN(S$):POKER,PEEK(R)-64:NEXT:RETURN
170 PRINT@L,S$;:FORR=MC+LTOMC+(L-1)+LEN(S$):POKER,PEEK(R)-64:NEXT:RETURN
500 GOSUB1000:D(1)=-1:D(2)=1:D(3)=-32:D(4)=32:K=383:MC=16384:K(65)=1:K(87)=2:K(83)=3:K(90)=4:Q=107:U=96:A=86:B=99:H=79
501 K(107)=2:K(86)=3:K(128)=1:K(79)=4:FORT=1TO64:K(T)=1:NEXT:S1=16869:S2=16868:K(70)=1:K(84)=2:K(72)=3:K(71)=4:
502 FORT=143TO255STEP16:K(T)=1:NEXT
505 LI=4:LV=12:RD=0:IFS>HSTHENHS=S
506 S=0:V=0:D=0
510 CLS:RD=RD+1:LV=LV-1:IFLV<5THENLV=5
520 FORT=0TO30:POKEMC+T,32:POKEMC+T+480,32:NEXT:POKE16895,32:POKE16384+31,32
530 PRINT@480,"score";:PRINT@494,"round";:PRINT@503,"lives";
550 FORT=1TORD*2:X=RND(30):Y=RND(11)+2:C=RND(7):R=32*Y+X:PRINT@R,CHR$(128);
560 PRINT@R-32,CHR$(143+(16*C));:PRINT@R-1,CHR$(143+(16*C));
570 PRINT@R+32,CHR$(143+(16*C));:PRINT@R+1,CHR$(143+(16*C));
580 NEXT
590 GOSUB9:GOSUB150:GOSUB160:S$=" * SNAKEBITE * HIGH SCORE"+STR$(HS):L=0:GOSUB170:RETURN
1000 CLS
1001 PRINT"    snakebite by jim gerrie"
1002 PRINT"  INSPIRED BY THE ZX81 GAME...":PRINT
1003 PRINT"   THE MICE HAVE HAD ENOUGH!"
1004 PRINT"FOR YEARS THEY HAVE BEEN EATEN "
1005 PRINT"BY DEADLY SNAKES, AND THEY HAVE"
1006 PRINT"DECIDED TO FIGHT BACK."
1007 PRINT"GUIDE YOUR BRAVE LITTLE MOUSE v"
1008 PRINT"AROUND THE SCREEN USING THE"
1009 PRINT"awsz KEYS (OR fthg KEYS)."
1010 PRINT"WHEN THE NASTY SNAKE IS NOT"    
1011 PRINT"LOOKING, BITE HIS TAIL OFF, ONE"
1012 PRINT"BIT AT A TIME, UNTIL YOU HAVE"
1013 PRINT"EATEN HIM ALL.":PRINT
1014 PRINT"   PRESS spacebar TO BEGIN...";
1050 I$=INKEY$:T=RND(1000):IFI$=""THEN1050
1060 RETURN
